Skip to content

查询商家券详情

商户可通过该接口查询已创建的商家券批次详情信息。

请求参数类型描述
stock_idstring批次号
php
$instance->v3->marketing->busifavor->stocks->_stock_id_->getAsync([
  'stock_id' => '1212',
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
  print_r(json_decode((string) $response->getBody(), true));
})
->wait();
php
$instance->chain('v3/marketing/busifavor/stocks/{stock_id}')->getAsync([
  'stock_id' => '1212',
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
  print_r(json_decode((string) $response->getBody(), true));
})
->wait();
php
$instance['v3/marketing/busifavor/stocks/{stock_id}']->getAsync([
  'stock_id' => '1212',
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
  print_r(json_decode((string) $response->getBody(), true));
})
->wait();
php
$response = $instance->v3->marketing->busifavor->stocks->_stock_id_->get([
  'stock_id' => '1212',
]);
print_r(json_decode((string) $response->getBody(), true));
php
$response = $instance->chain('v3/marketing/busifavor/stocks/{stock_id}')->get([
  'stock_id' => '1212',
]);
print_r(json_decode((string) $response->getBody(), true));
php
$response = $instance['v3/marketing/busifavor/stocks/{stock_id}']->get([
  'stock_id' => '1212',
]);
print_r(json_decode((string) $response->getBody(), true));
返回字典类型描述
stock_namestring商家券批次名称
belong_merchantstring批次归属商户号
commentstring批次备注
goods_namestring适用商品范围
stock_typestring批次类型
coupon_use_ruleobject核销规则
coupon_available_timeobject券可核销时间
available_begin_timestring开始时间
available_end_timestring结束时间
available_day_after_receiveinteger生效后N天内有效
available_weekobject固定周期有效时间段
week_daystring[]可用星期数
available_day_timeobject[]当天可用时间段
begin_timeinteger当天可用开始时间
end_timeinteger当天可用结束时间
irregulary_avaliable_timeobject[]无规律的有效时间段
begin_timestring开始时间
end_timestring结束时间
wait_days_after_receiveinteger领取后N天开始生效
fixed_normal_couponobject固定面额满减券使用规则
discount_amountinteger优惠金额
transaction_minimuminteger消费门槛
discount_couponobject折扣券使用规则
discount_percentinteger折扣比例
transaction_minimuminteger消费门槛
exchange_couponobject换购券使用规则
exchange_priceinteger单品换购价
transaction_minimuminteger消费门槛
use_methodstring核销方式
mini_programs_appidstring小程序appid
mini_programs_pathstring小程序path
stock_send_ruleobject发放规则
max_amountinteger批次总预算
max_couponsinteger批次最大发放个数
max_coupons_per_userinteger用户最大可领个数
max_amount_by_dayinteger单天发放上限金额
max_coupons_by_dayinteger单天发放上限个数
natural_person_limitboolean是否开启自然人限制
prevent_api_abuseboolean可疑账号拦截
transferableboolean是否允许转赠
shareableboolean是否允许分享链接
custom_entranceobject自定义入口
mini_programs_infoobject小程序入口
mini_programs_appidstring商家小程序appid
mini_programs_pathstring商家小程序path
entrance_wordsstring入口文案
guiding_wordsstring引导文案
appidstring商户公众号appid
hall_idstring营销馆id
store_idstring可用门店id
code_display_modestringcode展示模式
display_pattern_infoobject样式信息
descriptionstring使用须知
merchant_logo_urlstring商户logo
merchant_namestring商户名称
background_colorstring背景颜色
coupon_image_urlstring券详情图片
finder_infoobject视频号相关信息
finder_idstring视频号ID
finder_video_idstring视频号视频ID
finder_video_cover_image_urlstring视频号封面图
stock_statestring批次状态
coupon_code_modestring券code模式
stock_idstring批次号
coupon_code_countobject券code数量
total_countinteger该批次总共已上传的code总数
available_countinteger该批次当前可用的code数
notify_configobject事件通知配置
notify_appidstring事件通知appid
send_count_informationobject批次发放情况
total_send_numinteger已发放券张数
total_send_amountinteger已发放券金额
today_send_numinteger单天已发放券张数
today_send_amountinteger单天已发放券金额
subsidyboolean是否允许营销补差

参阅 官方文档

修改商家券基本信息

商户可以通过该接口修改商家券基本信息

请求参数类型描述
stock_idstring批次号
jsonobject声明请求的JSON数据结构
custom_entranceobject自定义入口
mini_programs_infoobject小程序入口
mini_programs_appidstring商家小程序appid
mini_programs_pathstring商家小程序path
entrance_wordsstring入口文案
guiding_wordsstring引导文案
appidstring商户公众号appid
hall_idstring营销馆id
code_display_modestringcode展示模式
stock_namestring批次名称
commentstring批次备注
goods_namestring适用商品范围
out_request_nostring商户请求单号
display_pattern_infoobject样式信息
descriptionstring使用须知
merchant_logo_urlstring商户logo
merchant_namestring商户名称
background_colorstring背景颜色
coupon_image_urlstring券详情图片
finder_infoobject视频号相关信息
finder_idstring视频号ID
finder_video_idstring视频号视频ID
finder_video_cover_image_urlstring视频号封面图
coupon_use_ruleobject核销规则
use_methodstring核销方式
mini_programs_appidstring小程序appid
mini_programs_pathstring小程序path
stock_send_ruleobject发放规则
natural_person_limitboolean是否开启自然人限领
prevent_api_abuseboolean可疑账号拦截
notify_configobject事件通知配置
notify_appidstring事件通知appid
subsidyboolean是否允许营销补差
php
$instance->v3->marketing->busifavor->stocks->_stock_id_->patchAsync([
  'stock_id' => '101156451224',
  'json' => [
    'custom_entrance' => [
      'mini_programs_info' => [
        'mini_programs_appid' => 'wx234545656765876',
        'mini_programs_path' => '/path/index/index',
        'entrance_words' => '欢迎选购',
        'guiding_words' => '获取更多优惠',
      ],
      'appid' => 'wx324345hgfhfghfg',
      'hall_id' => '233455656',
      'code_display_mode' => 'BARCODE',
    ],
    'stock_name' => '8月1日活动券',
    'comment' => '活动使用',
    'goods_name' => 'xxx商品使用',
    'out_request_no' => '6122352020010133287985742',
    'display_pattern_info' => [
      'description' => 'xxx门店可用',
      'merchant_logo_url' => 'https://xxx',
      'merchant_name' => '微信支付',
      'background_color' => 'Color020',
      'coupon_image_url' => 'https://qpic.cn/xxx',
      'finder_info' => [
        'finder_id' => 'sph6Rngt2T4RlUf',
        'finder_video_id' => 'sph6Rngt2T4RlUf',
        'finder_video_cover_image_url' => 'https://wxpaylogo.qpic.cn/xxx',
      ],
    ],
    'coupon_use_rule' => [
      'use_method' => 'OFF_LINE',
      'mini_programs_appid' => 'wx23232232323',
      'mini_programs_path' => '/path/index/index',
    ],
    'stock_send_rule' => [
      'natural_person_limit' => true,
      'prevent_api_abuse' => true,
    ],
    'notify_config' => [
      'notify_appid' => 'wx23232232323',
    ],
    'subsidy' => true,
  ],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
  print_r($response->getStatusCode() === 204);
})
->wait();
php
$instance->chain('v3/marketing/busifavor/stocks/{stock_id}')->patchAsync([
  'stock_id' => '101156451224',
  'json' => [
    'custom_entrance' => [
      'mini_programs_info' => [
        'mini_programs_appid' => 'wx234545656765876',
        'mini_programs_path' => '/path/index/index',
        'entrance_words' => '欢迎选购',
        'guiding_words' => '获取更多优惠',
      ],
      'appid' => 'wx324345hgfhfghfg',
      'hall_id' => '233455656',
      'code_display_mode' => 'BARCODE',
    ],
    'stock_name' => '8月1日活动券',
    'comment' => '活动使用',
    'goods_name' => 'xxx商品使用',
    'out_request_no' => '6122352020010133287985742',
    'display_pattern_info' => [
      'description' => 'xxx门店可用',
      'merchant_logo_url' => 'https://xxx',
      'merchant_name' => '微信支付',
      'background_color' => 'Color020',
      'coupon_image_url' => 'https://qpic.cn/xxx',
      'finder_info' => [
        'finder_id' => 'sph6Rngt2T4RlUf',
        'finder_video_id' => 'sph6Rngt2T4RlUf',
        'finder_video_cover_image_url' => 'https://wxpaylogo.qpic.cn/xxx',
      ],
    ],
    'coupon_use_rule' => [
      'use_method' => 'OFF_LINE',
      'mini_programs_appid' => 'wx23232232323',
      'mini_programs_path' => '/path/index/index',
    ],
    'stock_send_rule' => [
      'natural_person_limit' => true,
      'prevent_api_abuse' => true,
    ],
    'notify_config' => [
      'notify_appid' => 'wx23232232323',
    ],
    'subsidy' => true,
  ],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
  print_r($response->getStatusCode() === 204);
})
->wait();
php
$instance['v3/marketing/busifavor/stocks/{stock_id}']->patchAsync([
  'stock_id' => '101156451224',
  'json' => [
    'custom_entrance' => [
      'mini_programs_info' => [
        'mini_programs_appid' => 'wx234545656765876',
        'mini_programs_path' => '/path/index/index',
        'entrance_words' => '欢迎选购',
        'guiding_words' => '获取更多优惠',
      ],
      'appid' => 'wx324345hgfhfghfg',
      'hall_id' => '233455656',
      'code_display_mode' => 'BARCODE',
    ],
    'stock_name' => '8月1日活动券',
    'comment' => '活动使用',
    'goods_name' => 'xxx商品使用',
    'out_request_no' => '6122352020010133287985742',
    'display_pattern_info' => [
      'description' => 'xxx门店可用',
      'merchant_logo_url' => 'https://xxx',
      'merchant_name' => '微信支付',
      'background_color' => 'Color020',
      'coupon_image_url' => 'https://qpic.cn/xxx',
      'finder_info' => [
        'finder_id' => 'sph6Rngt2T4RlUf',
        'finder_video_id' => 'sph6Rngt2T4RlUf',
        'finder_video_cover_image_url' => 'https://wxpaylogo.qpic.cn/xxx',
      ],
    ],
    'coupon_use_rule' => [
      'use_method' => 'OFF_LINE',
      'mini_programs_appid' => 'wx23232232323',
      'mini_programs_path' => '/path/index/index',
    ],
    'stock_send_rule' => [
      'natural_person_limit' => true,
      'prevent_api_abuse' => true,
    ],
    'notify_config' => [
      'notify_appid' => 'wx23232232323',
    ],
    'subsidy' => true,
  ],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
  print_r($response->getStatusCode() === 204);
})
->wait();
php
$response = $instance->v3->marketing->busifavor->stocks->_stock_id_->patch([
  'stock_id' => '101156451224',
  'json' => [
    'custom_entrance' => [
      'mini_programs_info' => [
        'mini_programs_appid' => 'wx234545656765876',
        'mini_programs_path' => '/path/index/index',
        'entrance_words' => '欢迎选购',
        'guiding_words' => '获取更多优惠',
      ],
      'appid' => 'wx324345hgfhfghfg',
      'hall_id' => '233455656',
      'code_display_mode' => 'BARCODE',
    ],
    'stock_name' => '8月1日活动券',
    'comment' => '活动使用',
    'goods_name' => 'xxx商品使用',
    'out_request_no' => '6122352020010133287985742',
    'display_pattern_info' => [
      'description' => 'xxx门店可用',
      'merchant_logo_url' => 'https://xxx',
      'merchant_name' => '微信支付',
      'background_color' => 'Color020',
      'coupon_image_url' => 'https://qpic.cn/xxx',
      'finder_info' => [
        'finder_id' => 'sph6Rngt2T4RlUf',
        'finder_video_id' => 'sph6Rngt2T4RlUf',
        'finder_video_cover_image_url' => 'https://wxpaylogo.qpic.cn/xxx',
      ],
    ],
    'coupon_use_rule' => [
      'use_method' => 'OFF_LINE',
      'mini_programs_appid' => 'wx23232232323',
      'mini_programs_path' => '/path/index/index',
    ],
    'stock_send_rule' => [
      'natural_person_limit' => true,
      'prevent_api_abuse' => true,
    ],
    'notify_config' => [
      'notify_appid' => 'wx23232232323',
    ],
    'subsidy' => true,
  ],
]);
print_r($response->getStatusCode() === 204);
php
$response = $instance->chain('v3/marketing/busifavor/stocks/{stock_id}')->patch([
  'stock_id' => '101156451224',
  'json' => [
    'custom_entrance' => [
      'mini_programs_info' => [
        'mini_programs_appid' => 'wx234545656765876',
        'mini_programs_path' => '/path/index/index',
        'entrance_words' => '欢迎选购',
        'guiding_words' => '获取更多优惠',
      ],
      'appid' => 'wx324345hgfhfghfg',
      'hall_id' => '233455656',
      'code_display_mode' => 'BARCODE',
    ],
    'stock_name' => '8月1日活动券',
    'comment' => '活动使用',
    'goods_name' => 'xxx商品使用',
    'out_request_no' => '6122352020010133287985742',
    'display_pattern_info' => [
      'description' => 'xxx门店可用',
      'merchant_logo_url' => 'https://xxx',
      'merchant_name' => '微信支付',
      'background_color' => 'Color020',
      'coupon_image_url' => 'https://qpic.cn/xxx',
      'finder_info' => [
        'finder_id' => 'sph6Rngt2T4RlUf',
        'finder_video_id' => 'sph6Rngt2T4RlUf',
        'finder_video_cover_image_url' => 'https://wxpaylogo.qpic.cn/xxx',
      ],
    ],
    'coupon_use_rule' => [
      'use_method' => 'OFF_LINE',
      'mini_programs_appid' => 'wx23232232323',
      'mini_programs_path' => '/path/index/index',
    ],
    'stock_send_rule' => [
      'natural_person_limit' => true,
      'prevent_api_abuse' => true,
    ],
    'notify_config' => [
      'notify_appid' => 'wx23232232323',
    ],
    'subsidy' => true,
  ],
]);
print_r($response->getStatusCode() === 204);
php
$response = $instance['v3/marketing/busifavor/stocks/{stock_id}']->patch([
  'stock_id' => '101156451224',
  'json' => [
    'custom_entrance' => [
      'mini_programs_info' => [
        'mini_programs_appid' => 'wx234545656765876',
        'mini_programs_path' => '/path/index/index',
        'entrance_words' => '欢迎选购',
        'guiding_words' => '获取更多优惠',
      ],
      'appid' => 'wx324345hgfhfghfg',
      'hall_id' => '233455656',
      'code_display_mode' => 'BARCODE',
    ],
    'stock_name' => '8月1日活动券',
    'comment' => '活动使用',
    'goods_name' => 'xxx商品使用',
    'out_request_no' => '6122352020010133287985742',
    'display_pattern_info' => [
      'description' => 'xxx门店可用',
      'merchant_logo_url' => 'https://xxx',
      'merchant_name' => '微信支付',
      'background_color' => 'Color020',
      'coupon_image_url' => 'https://qpic.cn/xxx',
      'finder_info' => [
        'finder_id' => 'sph6Rngt2T4RlUf',
        'finder_video_id' => 'sph6Rngt2T4RlUf',
        'finder_video_cover_image_url' => 'https://wxpaylogo.qpic.cn/xxx',
      ],
    ],
    'coupon_use_rule' => [
      'use_method' => 'OFF_LINE',
      'mini_programs_appid' => 'wx23232232323',
      'mini_programs_path' => '/path/index/index',
    ],
    'stock_send_rule' => [
      'natural_person_limit' => true,
      'prevent_api_abuse' => true,
    ],
    'notify_config' => [
      'notify_appid' => 'wx23232232323',
    ],
    'subsidy' => true,
  ],
]);
print_r($response->getStatusCode() === 204);
返回字典类型描述
空字符串(无返回内容)

参阅 官方文档

Published on the GitHub by TheNorthMemory